package com.zheng.mall.common.dto;

import lombok.Builder;

/**
 *  Swagger自定义配置
 * @author zheng
 */
@Builder
public class SwaggerProperties {
    /**
     * API文档生成基础路径
     */
    private String apiBasePackage;
    /**
     * 是否要启用登录认证
     */
    private boolean enableSecurity;
    /**
     * 文档标题
     */
    private String title;
    /**
     * 文档描述
     */
    private String description;
    /**
     * 文档版本
     */
    private String version;
    /**
     * 文档联系人姓名
     */
    private String contactName;
    /**
     * 文档联系人网址
     */
    private String contactUrl;
    /**
     * 文档联系人邮箱
     */
    private String contactEmail;


    @Override
    public String toString() {
        return "SwaggerProperties{" +
                "apiBasePackage='" + apiBasePackage + '\'' +
                ", enableSecurity=" + enableSecurity +
                ", title='" + title + '\'' +
                ", description='" + description + '\'' +
                ", version='" + version + '\'' +
                ", contactName='" + contactName + '\'' +
                ", contactUrl='" + contactUrl + '\'' +
                ", contactEmail='" + contactEmail + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        SwaggerProperties that = (SwaggerProperties) o;

        if (enableSecurity != that.enableSecurity) return false;
        if (!apiBasePackage.equals(that.apiBasePackage)) return false;
        if (!title.equals(that.title)) return false;
        if (!description.equals(that.description)) return false;
        if (!version.equals(that.version)) return false;
        if (!contactName.equals(that.contactName)) return false;
        if (!contactUrl.equals(that.contactUrl)) return false;
        return contactEmail.equals(that.contactEmail);
    }

    @Override
    public int hashCode() {
        int result = apiBasePackage.hashCode();
        result = 31 * result + (enableSecurity ? 1 : 0);
        result = 31 * result + title.hashCode();
        result = 31 * result + description.hashCode();
        result = 31 * result + version.hashCode();
        result = 31 * result + contactName.hashCode();
        result = 31 * result + contactUrl.hashCode();
        result = 31 * result + contactEmail.hashCode();
        return result;
    }

    public String getApiBasePackage() {
        return apiBasePackage;
    }

    public void setApiBasePackage(String apiBasePackage) {
        this.apiBasePackage = apiBasePackage;
    }

    public boolean isEnableSecurity() {
        return enableSecurity;
    }

    public void setEnableSecurity(boolean enableSecurity) {
        this.enableSecurity = enableSecurity;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public String getContactName() {
        return contactName;
    }

    public void setContactName(String contactName) {
        this.contactName = contactName;
    }

    public String getContactUrl() {
        return contactUrl;
    }

    public void setContactUrl(String contactUrl) {
        this.contactUrl = contactUrl;
    }

    public String getContactEmail() {
        return contactEmail;
    }

    public void setContactEmail(String contactEmail) {
        this.contactEmail = contactEmail;
    }
}
